
import requests
headers = {
    "User-Agent": "Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/84.0.4147.105 Safari/537.36"}
# resp = requests.get("https://www.baidu.com", headers=headers)
# print(resp.content.decode("utf-8"))
resp = requests.get("http://www.geyanw.com/", headers=headers)
print(resp.content.decode("gb2312"))
# 请求的参数
print(resp.request.headers)
# 写入文件
""" with open("./geyan.html", "wb") as f:
    f.write(resp.content) """